<!--
 * @Autor: Kadia
 * @Date: 2021-07-01 07:31:32
 * @LastEditors: Kadia
 * @Connect: nefukadia@foxmail.com
 * @LastEditTime: 2021-07-02 18:05:09
-->
<template>
    <div v-if="prepare">
        <my-Menu active="1" :hasLogin="hasLogin"></my-Menu>
        <div class="min-div" style="text-align:center;">
            <img style="margin-top:150px;" src="../../assets/gh_29bed20f0009_430.jpg" />
        </div>  
        <my-footer></my-footer>
    </div>
</template>
<script>
export default {
    data(){
        return {
            prepare:false,
            activeIndex:"1",
            hasLogin:false
        }
    },
    created () {
        const that=this;
        if(that.$cookies.get('email')!=null&&that.$cookies.get('password')!=null){
            that.$axios({
                url:that.myConfig.manageApiUrl+'/login.php',
                method:'post',
                data:{
                    email:that.$cookies.get('email'),
                    password:that.$cookies.get('password')
                }
            }).then(function(res){
                that.prepare=true;
                if(res.data.errCode==200){
                    that.myConfig.shopId=res.data.shopId;
                    that.hasLogin=true;
                }else{
                    that.$cookies.remove('email');
                    that.$cookies.remove('password');
                }
            }).catch(function(err){
                that.prepare=false;
                that.$message.warning('系统繁忙，请稍后再试');
            });
        }else{
            that.hasLogin=false;
            that.prepare=true;
        }
    },
    methods: {
        handleSelect(param){
            console.log(param);
            console.log(this.activeIndex);
        }
    }
}
</script>
<style scoped>

</style>